import React from 'react';
import type { FormProps } from 'antd';
import { Button, Checkbox, Form, Input,Card } from 'antd';

export default function  Login(props){
const onFinish: FormProps['onFinish'] = (values) => {
  localStorage.getItem('token', values);
  props.history.push('/admin/home')
};
const onFinishFailed: FormProps['onFinishFailed'] = (errorInfo) => {
  console.log('Failed:', errorInfo);
};
return(
  <div>
    <Card style={{width:"400px",margin:"50px auto"}}>
  <Form onFinish={onFinish}>
    <Form.Item
      label="手机号"
      name="username"
      rules={[{ required: true, message: 'Please input your username!' }]}
    >
      <Input />
    </Form.Item>

    <Form.Item
      label="密码   "
      name="password"
      rules={[{ required: true, message: 'Please input your password!' }]}
    >
      <Input.Password />
    </Form.Item>

    <Form.Item label={null}>
      <Button type="primary" htmlType="submit">
        完成
      </Button>
    </Form.Item>
  </Form>
    </Card>
  </div>
)
}





